﻿<!--
//********************************************************************************//
//创建日期：<创建日期，2017-09-19>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：立成财务接口(自来水)
//********************************************************************************//
    -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../../../../css/main.css" rel="stylesheet" />
    <link href="../../../JS/layui/css/layui.css" rel="stylesheet" />
    <script src="../../../JS/layui/layui.js"></script>
    <script src="../../../JS/AddEditCancel.js"></script>
    <script src="../../../PageJS/common.js"></script>
    <script src="../../../PageJS/common.verify.js"></script>
    <script defer src="../../../../PageJS/YSZW/LiChengCWJK.js"></script>
    <!--<script src="../../../JS/jquery-1.8.3.js"></script>-->
    <script src="../../../EasyUI/jquery.min.js"></script>
    <script src="../../../EasyUI/jquery.easyui.min.js"></script>
    <link href="../../../EasyUI/themes/color.css" rel="stylesheet" />
    <link href="../../../EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="../../../EasyUI/themes/material/easyui.css" rel="stylesheet" />
    <!--引用easyui-->

</head>
<body>
    <form class="layui-form">
        <div id="divContent" style="width:98%;margin:auto">
            <div class="tabletitle1" align="center" style="height:23px">
                立成财务接口
            </div>
            <div class="layui-form-item" style="padding-top:10px">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:60px">账务年月:</label>
                    <div class="layui-input-inline" style="width: 80px;">
                        <input id="cZWYM" autocomplete="off" class="layui-input" onkeydown="return onlyNum();">
                    </div>
                    <div class="layui-input-inline" style="width: 90px;">
                        <button id="oSCSJ" class="layui-btn layui-btn-primary" type="button">生成数据</button>
                    </div>
                    <div class="layui-input-inline" style="width: 80px;padding-left:15px">
                        <button id="CheckData" class="layui-btn layui-btn-primary" type="button" style="color:red;">数据检测</button>
                        <!--<a id="CheckData" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-no'">数据检测</a>-->
                    </div>
                    <div class="layui-input-inline" style="width: 80px;padding-left:15px">
                        <button id="oDRLC" class="layui-btn layui-btn-primary" type="button">导入立成</button>
                    </div>
                    </div>
            </div>
            <hr />
            <div>
                <div style="float:left;width:20%">
                    <fieldset class="layui-elem-field" >
                        <legend style="font-size:13px;">凭证信息</legend>
                        <div class="layui-field-box" style="height: 480px; overflow: auto">
                            <table id="ContentList1" name="ContentList" class="layui-table" style="width:100%">
                                <thead>
                                    <tr>
                                        <th style="text-align:center">凭证连续编号</th>
                                        <th style="text-align: center">凭证类型</th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                    </fieldset>
                </div>
                <div style="float:left;width:1%">
                    &nbsp;
                </div>
                <div style="float:left;width:79%;">
                    <fieldset class="layui-elem-field">
                        <legend style="font-size:13px;">凭证明细</legend>
                        <div class="layui-field-box">
                                <div style="overflow: auto; height: 480px;width:1000px">
                                    <table id="ContentList2" name="ContentList" class="layui-table" style="width:3100px">
                                        <thead>
                                            <tr>
                                                <th style="text-align:center">工作年月</th>
                                                <th style="text-align:center">凭证连续编号</th>
                                                <th style="text-align:center">收付转记类型</th>
                                                <th style="text-align:center">现银转记类型</th>
                                                <th style="text-align:center">科目代码</th>
                                                <th style="text-align:center">借方金额</th>
                                                <th style="text-align:center">贷方金额</th>
                                                <th style="text-align:center">客户代码</th>
                                                <th style="text-align:center">客户名称</th>
                                                <th style="text-align:center">分录顺序号</th>
                                                <th style="text-align:center">备注</th>
                                                <th style="text-align:center">摘要</th>
                                                <th style="text-align:center">外币借方金额</th>
                                                <th style="text-align:center">外币贷方金额</th>
                                                <th style="text-align:center">汇率</th>
                                                <th style="text-align:center">借方数量</th>
                                                <th style="text-align:center">贷方数量</th>
                                                <th style="text-align:center">单价</th>
                                                <th style="text-align:center">发票编号</th>
                                                <th style="text-align:center">结算方式</th>
                                                <th style="text-align:center">票据编号</th>
                                                <th style="text-align:center">币种</th>
                                                <th style="text-align:center">凭证录入日期</th>
                                                <th style="text-align:center">核算代码</th>
                                                <th style="text-align:center">人员代码</th>
                                                <th style="text-align:center">单据编号</th>
                                                <th style="text-align:center">凭证编号</th>
                                                <th style="text-align:center">制单</th>
                                                <th style="text-align:center">附件</th>
                                                <th style="text-align:center">复核</th>
                                                <th style="text-align:center">实际日期</th>
                                                <th style="text-align:center">项目代码</th>
                                                <th style="text-align:center">项目名称</th>
                                            </tr>
                                        </thead>
                                    </table>
                                </div>
                        </div>
                    </fieldset>
                </div>
            </div>
                        </div>
        <!--数据检测弹窗-->
        <div id="dataCheckForm">

        </div>
</form>
</body>

<script>

    $().ready(function () {
        $("#CheckData").hide();  //初始化隐藏数据检测按钮
    })

   //生成数据 判断是否显示数据检测按钮
    $("#oSCSJ").click(function () {
        var time = $("#cZWYM").val();
        var year = time.substring(0, 4);
        var month = time.substring(4, 6);
        $.get(
           '../../../ashx/QSSFZW/LCCWDataCheck.ashx',
           { type: 'checkData', year: year, month: month },
           function (e) {
               if (e!= "1") {
                   $("#CheckData").show();  //没通过显示检测按钮
               }
           })
    })

    //检测数据
    $("#CheckData").click(function () {
        var time = $("#cZWYM").val();
        var year = time.substring(0, 4);
        var month = time.substring(4, 6);
        $.get(
            '../../../ashx/QSSFZW/LCCWDataCheck.ashx',
            { type: 'checkData', year: year,month:month },
            function (e) {
                if (e == "-1")
                {
                    alert("当前年月可能没有数据,或重新检测!");
                }
                else if (e == "-2") {
                    alert("非托(预收)与转账(预收)数目不一致!");
                    $("#dataCheckForm").dialog({
                        title: "数据对比",						//弹出界面的标题		
                        width: 1000,
                        height: 700,
                        href: "LiChengDataContrast.html",						//弹出界面的url地址		
                        queryParams: { type: e },
                        modal: true						//是否是模态窗口		
                    })
                }
                else if (e == "1")
                {
                    alert("数据检测通过");
                    $("#dataCheckForm").dialog({
                        title: "数据对比",						//弹出界面的标题		
                        width: 1000,
                        height: 700,
                        closed: false,
                        cache: true,
                        collapsible: true,
                        href: "LiChengDataContrast.html",//弹出界面的url地址		
                        queryParams: { type: e },
                        modal: true						//是否是模态窗口		
                    });
                }
                else if (e == "0")
                {
                    $("#dataCheckForm").dialog({
                        title: "数据对比",						//弹出界面的标题		
                        width: 1000,
                        height: 700,
                        closed: false,
                        cache: true,
                        collapsible: true,
                        href: "LiChengDataContrast.html",//弹出界面的url地址		
                        queryParams: { type: e },
                        modal: true						//是否是模态窗口		
                    });
                }
                else if (e == "-3") {
                    $("#dataCheckForm").dialog({
                        title: "数据对比",						//弹出界面的标题		
                        width: 1000,
                        height: 700,
                        href: "LiChengDataContrast.html",						//弹出界面的url地址		
                        queryParams: { type: e },
                        modal: true						//是否是模态窗口		
                    })
                }
            })
    })

</script>
</html>